package 力扣日常刷题.木23一月.第02天302;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

/**
 * @author 帅小伙
 * @date 2022/3/2
 * @description
 */
public class Demo17小团的复制粘贴 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] a = new int[n + 1];
        int[] b = new int[n + 1];
        for (int i = 1; i <= n; i++) {
            a[i] = scanner.nextInt();
        }
        Arrays.fill(b, -1);

        int m = scanner.nextInt();
        ArrayList<Integer> ans = new ArrayList<>();
        for (int i = 0; i < m; i++) {
            int op = scanner.nextInt();
            if (op == 2) {
                ans.add(b[scanner.nextInt()]);
            } else {
                int k = scanner.nextInt(), x = scanner.nextInt(), y = scanner.nextInt();
                for (int j = 0; j < k && (y + j) <= n && (x + j) <= n; j++) {
                    b[y + j] = a[x + j];
                }
            }
        }


        for (int i = 0; i < ans.size(); i++) {
            System.out.println(ans.get(i));
        }


    }

}
